<script setup lang="ts">
import { PropType, ref } from 'vue'

import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { useI18n } from '@/hooks/web/useI18n'
import { ElTag } from 'element-plus'
const { t } = useI18n()
defineProps({
  currentRow: {
    type: Object,
    default: () => undefined
  }
  // detailSchema: {
  //   type: Array as PropType<DescriptionsSchema[]>,
  //   default: () => []
  // }
})

const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'noticeHeader',
    label: t('tableDemo.title')
  },
  {
    field: 'noticeContent',
    label: t('exampleDemo.content')
  },
  {
    field: 'depName',
    label: t('device.depName')
  },

  {
    field: 'userName',
    label: t('device.userName')
  },

  {
    field: 'isEnabled',
    label: t('menu.status')
    // slots: {
    //   default: (data: any) => {
    //     return (
    //       <>
    //         <ElTag type={data.isEnabled === 0 ? 'danger' : 'success'}>
    //           {data.isEnabled === 1 ? t('userDemo.enable') : t('userDemo.disable')}
    //         </ElTag>
    //       </>
    //     )
    //   }
    // }
  }
])
</script>

<template>
  <Descriptions :schema="detailSchema" :data="currentRow || {}" />
</template>
